// 封装mock数据模拟
import Mock from 'mockjs'

// 图表数据
let List = [];
export default {
    getStatisticalData: () => {
        // Mock.random.float 产生随机数100到8000之间 保留小数 最小0位 最大0位
        for (let i = 0; i < 7; i++) {
            List.push(
                Mock.mock({
                    DCS: Mock.Random.float(100, 8000, 0, 0),
                    MOM: Mock.Random.float(100, 8000, 0, 0),
                    APC: Mock.Random.float(100, 8000, 0, 0),
                    BATCH: Mock.Random.float(100, 8000, 0, 0),
                    AAS: Mock.Random.float(100, 8000, 0, 0),
                    IDM: Mock.Random.float(100, 8000, 0, 0),
                    SCADA: Mock.Random.float(100, 8000, 0, 0),
                })
            )
        }
        return {
            code: 20000, // 状态码
            data: {
                // 饼图
                videoData: [
                    {
                        name: "小米",
                        value: 2999
                    },
                    {
                        name: "苹果",
                        value: 5999
                    },
                    {
                        name: "魅族",
                        value: 5999
                    },
                    {
                        name: "vivo",
                        value: 5999
                    },
                    {
                        name: "oppo",
                        value: 5999
                    },
                ],
                // 柱状图
                userData: [
                    {
                        birth: '周一',
                        new: 5,
                        active: 200
                    },
                    {
                        birth: '周二',
                        new: 10,
                        active: 200
                    },
                    {
                        birth: '周三',
                        new: 12,
                        active: 500
                    },
                    {
                        birth: '周四',
                        new: 13,
                        active: 550
                    },
                    {
                        birth: '周五',
                        new: 13,
                        active: 550
                    },
                    {
                        birth: '周六',
                        new: 13,
                        active: 550
                    },
                    {
                        birth: '周日',
                        new: 13,
                        active: 550
                    },
                ],
                // 折线图
                orderData: {
                    birth: ['20191001', '20191002', '20191003', '20191004', '20191005', '20191006', '20191007'],
                    data: List
                },
                // 列表数据
                tableData: [
                    {
                        name: "DCS",
                        todayBuy: 100,
                        monthBuy: 300,
                        totalBuy: 800,
                    },
                    {
                        name: "MOM",
                        todayBuy: 100,
                        monthBuy: 300,
                        totalBuy: 800,
                    },
                    {
                        name: "APC",
                        todayBuy: 100,
                        monthBuy: 300,
                        totalBuy: 800,
                    },
                    {
                        name: "BATCH",
                        todayBuy: 100,
                        monthBuy: 300,
                        totalBuy: 800,
                    },
                    {
                        name: "AAS",
                        todayBuy: 100,
                        monthBuy: 300,
                        totalBuy: 800,
                    },
                    {
                        name: "IDM",
                        todayBuy: 100,
                        monthBuy: 300,
                        totalBuy: 800,
                    },
                    {
                        name: "SCADA",
                        todayBuy: 100,
                        monthBuy: 300,
                        totalBuy: 800,
                    },
                ],
            }
        }
    }
}